pi = 3.14159  # approximate
diameter = 3

# Create a variable called 'radius' equal to half the diameter
radius = float(diameter / 2)

# Create a variable called 'area', using the formula for the area of a circle: pi times the radius squared
area = pi * (radius ** 2)

print(radius)
print(area)

# 交换两个变量
a = [1, 2, 3]
b = [3, 2, 1]
######################################################################

# Your code goes here. Swap the values to which a and b refer.
# If you get stuck, you can always uncomment one or both of the lines in
# the next cell for a hint, or to peek at the solution.
c = a
a = b
b = c
print(a)
print(b)

a, b = b, a
print(a)
print(b)

help(round)


def round_to_two_places(num):
    """Return the given number rounded to two decimal places.

    >>> round_to_two_places(3.14159)
    3.14
    """
    # Replace this body with your own code.
    # ("pass" is a keyword that does literally nothing. We used it as a placeholder
    # because after we begin a code block, Python requires at least one line of code)
    # pass
    return round(num, 2)


def to_smash(total_candies, friends_num=3):
    """Return the number of leftover candies that must be smashed after distributing
    the given number of candies evenly between 3 friends.

    >>> to_smash(91,3)
    1
    """
    return total_candies % friends_num